package com.pj.wisdomlogistics.utils;

import android.view.View;
import android.widget.Button;

import com.pj.wisdomlogistics.R;

/**
 * Created by WuFan on 2017/11/8.
 */

public class ButtonGrayUtils {
    public static void buttonGray(Button mBtOn , Button mBtOff , String textOn , String textOff , boolean isShow){
        if(!isShow) return;
        mBtOn.setVisibility(View.VISIBLE);
        mBtOff.setVisibility(View.VISIBLE);
        mBtOn.setText(textOn);
        mBtOff.setText(textOff);
        mBtOn.setBackgroundResource(R.drawable.button_gray);
        mBtOff.setBackgroundResource(R.drawable.button_gray);
        mBtOn.setEnabled(false);
        mBtOff.setEnabled(false);
    }

    public static void buttonGray(Button mBt , String text , boolean isShow){
        if (!isShow) return;
        mBt.setVisibility(View.VISIBLE);
        mBt.setText(text);
        mBt.setBackgroundResource(R.drawable.button_gray);
        mBt.setEnabled(false);
    }
}
